/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 *
 * http://www.gnu.org/copyleft/gpl.html
 */

package l1j.server.server.serverpackets;

import java.util.logging.Logger;

import l1j.server.server.Opcodes;
import l1j.server.server.model.Instance.L1ItemInstance;
import l1j.server.server.model.Instance.L1PcInstance;

// Referenced classes of package l1j.server.server.serverpackets:
// ServerBasePacket, S_OwnCharStatus, S_SystemMessage

public class S_DeleteInventoryItem extends ServerBasePacket {

	private static final String S_DELETE_INVENTORY_ITEM = "[S] S_DeleteInventoryItem";
	private static Logger _log = Logger.getLogger(S_DeleteInventoryItem.class
			.getName());

	public S_DeleteInventoryItem(L1PcInstance pc, L1ItemInstance item) {
		if (item != null) {
			writeC(Opcodes.S_OPCODE_DELETEINVENTORYITEM);
			writeD(item.getId());
			pc.sendPackets(new S_OwnCharStatus2(pc));
		}
		/*
		 * else { _char.sendPackets(new S_SystemMessage("\uC0AD\uC81C\uD560
		 * \uC544\uC774\uD15C\uC774 \uC874\uC7AC\uD558\uC9C0
		 * \uC54A\uC2B5\uB2C8\uB2E4.")); }
		 */
	}

	@Override
	public byte[] getContent() {
		return getBytes();
	}

	public String getType() {
		return S_DELETE_INVENTORY_ITEM;
	}
}
